-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF-#6696: Use cached dtypes in fillna when possible. #6697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good, besides the changes related to laziness, let's separate them and discuss in a separate PR
Signed-off-by: Andrey Pavlenko <[email protected]>
e14be58
to
d6712ce
Compare
d6712ce
to
92640b1
Compare
dtype = pandas.Series(value).dtype | ||
if all( | ||
find_common_type([t, dtype]) == t for t in self._modin_frame.dtypes | ||
): | ||
new_dtypes = self._modin_frame.dtypes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't we simply fill new dtypes with the find_common_type
results?
dtype = pandas.Series(value).dtype | |
if all( | |
find_common_type([t, dtype]) == t for t in self._modin_frame.dtypes | |
): | |
new_dtypes = self._modin_frame.dtypes | |
dtype = pandas.Series(value).dtype | |
new_dtypes = pandas.Series({col: find_common_type([t, dtype]) for col, t in self._modin_frame.dtypes.items()}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the new dtype depends on whether there are NAs in the frame or not. If there no NAs, the dtype is not changed, otherwise, it's changed to the common. We can't analyze the data here, but we can make the assumption, that the dtype will not changed if it's already the common one.
value_dtypes = pandas.DataFrame( | ||
{k: [v] for (k, v) in value.items()} | ||
).dtypes | ||
if all( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question here
What do these changes do?
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
docs/development/architecture.rst
is up-to-date